home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / source.lha / Geomview / src / bin / warp / next / EditObject.m < prev    next >
Text File  |  1993-06-29  |  2KB  |  108 lines

  1.  
  2. #import "point3.h"
  3. #import "api.h"
  4. #import "EditObject.h"
  5.  
  6. @implementation EditObject
  7. ;
  8.  
  9. static id editPanelID, positionFormID, strengthSliderID, 
  10.   stretchinessSliderID, selfID;
  11.  
  12. - cancel:sender
  13. {
  14.   apiThaw();
  15.   [editPanel performClose:self];
  16.   [NXApp stopModal];
  17.   return self;
  18. }
  19.  
  20. - awakeFromNib
  21. {
  22.   editPanelID = editPanel;
  23.   positionFormID = positionForm;
  24.   strengthSliderID = strengthSlider;
  25.   stretchinessSliderID = stretchinessSlider;
  26.   selfID = self;
  27.   [editPanel setAvoidsActivation:YES];
  28.   return self;
  29. }
  30.     
  31.  
  32. - readLocation:sender
  33. {
  34.   apiEditLocation();
  35.   return self;
  36. }
  37.  
  38. - set:sender
  39. {
  40.   apiEditSet();
  41.   apiThaw();
  42.   [editPanel performClose:self];
  43.   [NXApp stopModal];
  44.   return self;
  45. }
  46.  
  47. - setAll:sender
  48. {
  49.   apiEditSetAll();
  50.   apiThaw();
  51.   [editPanel performClose:self];
  52.   [NXApp stopModal];
  53.   return self;
  54. }
  55.  
  56. - openPanel:sender
  57. {
  58.   apiEdit();
  59.   return self;
  60. }
  61.  
  62. void uiSetSmoothnessBounds(float min, float max) {
  63.   [stretchinessSliderID setMinValue:min];
  64.   [stretchinessSliderID setMaxValue:max];
  65. }
  66.  
  67. void uiSetSmoothness(float smoothness) {
  68.   [stretchinessSliderID setFloatValue:smoothness];
  69. }
  70.  
  71. float uiGetSmoothness() {
  72.   return [stretchinessSliderID floatValue];
  73. }
  74.  
  75. void uiSetStrengthBounds(float min, float max) { 
  76.   [strengthSliderID setMinValue:min];
  77.   [strengthSliderID setMaxValue:max];
  78. }
  79.     
  80. void uiSetStrength(float strength) {
  81.   [strengthSliderID setFloatValue:strength];
  82. }
  83.  
  84. float uiGetStrength() {
  85.   return [strengthSliderID floatValue]; 
  86. }
  87.  
  88. void uiSetPoint(Point3 *pt) {
  89.   [positionFormID setFloatValue:pt->x at:0];
  90.   [positionFormID setFloatValue:pt->y at:1];
  91.   [positionFormID setFloatValue:pt->z at:2];
  92. }
  93.  
  94. void uiGetPoint(Point3 *pt) {
  95.   pt->x = [positionFormID floatValueAt:0];
  96.   pt->y = [positionFormID floatValueAt:1];
  97.   pt->z = [positionFormID floatValueAt:2];
  98. }             
  99.  
  100. void uiEdit(const char *name) {
  101.   apiFreeze();
  102.   [editPanelID setTitle:name];
  103.   [editPanelID makeKeyAndOrderFront:selfID];
  104.   [NXApp runModalFor:editPanelID];
  105. }
  106.  
  107. @end
  108.